<?php
if(!$_COOKIE["warabi_admin"]){
	header("Location:index.php");
	exit;
}

include_once('_lib/class.quickskin.php');
include_once('_lib/class.dpf.php');

$pid = intval($_GET['pid']);
$pid = empty($pid)?0:$pid;
$search_tel = $_POST["search_tel"];
$search_dev = $_POST["search_dev"];
$search_model = $_POST["search_model"];

$newpage = new QuickSkin("tpl/dpfuser.html");

$newpage->addtpl("leftmenu" , $addtplPrefix."left.php?type=2");

if(empty($search_tel)&&empty($search_dev)&&empty($search_model)){
	$newpage->assign('ifshowpid' , "block");
	$newpage->assign('ifshowall' , "none");
}
else{
	$newpage->assign('ifshowpid' , "none");
	$newpage->assign('ifshowall' , "block");
}


$dpfuserNum = $dpfuser->get_AllUser_Num();
$dpfuserArr = $dpfuser->get_AllUser_SelectResult($pid , $search_tel , $search_dev , $search_model);

$lpid = ceil($dpfuserNum/PER_NUM)-1;
$ppid = ($pid-1<0)?0:($pid-1);
$npid = ($pid+1>$lpid)?$lpid:($pid+1);

$newpage->assign( 'gray' , "#DDDDDD");
$newpage->assign( 'firstpage' , 0);
$newpage->assign( 'prevpage' , $ppid);
$newpage->assign( 'nextpage' , $npid);
$newpage->assign( 'lastpage' , $lpid);

$newpage -> assign('dpfuser' , $dpfuserArr);

$newpage -> output();

?>